class ProjectService {
    constructor(ctx) {
        this.ctx = ctx;
    }

    async getProjectById(id) {
        const rows = await this.ctx.db.execute(`select * from project where unlink = 0 where id = ${id}`);
        if(rows.length === 0) return false;
        else {
            return rows[0];
        }
    }
}

ProjectService.getInstance = function(){
    if(!ProjectService._instance) {
        ProjectService._instance = new ProjectService();
    }
    return ProjectService._instance;
}

module.exports = ProjectService;